package org.dromara.business.contracts;

import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.web3j.abi.EventEncoder;
import org.web3j.abi.FunctionEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.DynamicArray;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.StaticStruct;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.generated.Uint256;
import org.web3j.abi.datatypes.generated.Uint64;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.BaseEventResponse;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tuples.generated.Tuple5;
import org.web3j.tuples.generated.Tuple6;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the
 * <a href="https://github.com/hyperledger-web3j/web3j/tree/main/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 1.6.3.
 */
@SuppressWarnings("rawtypes")
public class StakingVaultNative extends Contract {
    public static final String BINARY = "0x60806040526001600355600160055534801561001a57600080fd5b50604051612c85380380612c85833981810160405281019061003c91906102fe565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036100af5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016100a6919061034d565b60405180910390fd5b6100be816101d760201b60201c565b5060018081905550600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610135576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161012c906103c5565b60405180910390fd5b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d60405160405180910390a250506103e5565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006102cb826102a0565b9050919050565b6102db816102c0565b81146102e657600080fd5b50565b6000815190506102f8816102d2565b92915050565b600080604083850312156103155761031461029b565b5b6000610323858286016102e9565b9250506020610334858286016102e9565b9150509250929050565b610347816102c0565b82525050565b6000602082019050610362600083018461033e565b92915050565b600082825260208201905092915050565b7f696e76616c6964206f70657261746f7200000000000000000000000000000000600082015250565b60006103af601083610368565b91506103ba82610379565b602082019050919050565b600060208201905081810360008301526103de816103a2565b9050919050565b612891806103f46000396000f3fe6080604052600436106101185760003560e01c80637acc0b20116100a057806399fbab881161006457806399fbab88146103ea578063ac8a584a1461042c578063b6b55f2514610455578063db518db214610471578063f2fde38b1461049a57610158565b80637acc0b2014610301578063899346c7146103425780638da5cb5b1461036d5780638ecdcbf2146103985780639870d7fe146103c157610158565b8063463615bb116100e7578063463615bb146102615780634de91a631461026b5780635c975abb146102965780636ea056a9146102c1578063715018a6146102ea57610158565b806302ee3a521461019357806313e7c9d8146101be578063143ba4f3146101fb5780632a6bc2dd1461022457610158565b36610158576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161014f90611a18565b60405180910390fd5b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018a90611a84565b60405180910390fd5b34801561019f57600080fd5b506101a86104c3565b6040516101b59190611bef565b60405180910390f35b3480156101ca57600080fd5b506101e560048036038101906101e09190611c79565b6105f6565b6040516101f29190611cb5565b60405180910390f35b34801561020757600080fd5b50610222600480360381019061021d9190611d8b565b610616565b005b34801561023057600080fd5b5061024b60048036038101906102469190611c79565b610897565b6040516102589190611ebb565b60405180910390f35b61026961092e565b005b34801561027757600080fd5b50610280610a55565b60405161028d9190611eec565b60405180910390f35b3480156102a257600080fd5b506102ab610a5b565b6040516102b89190611cb5565b60405180910390f35b3480156102cd57600080fd5b506102e860048036038101906102e39190611f71565b610a71565b005b3480156102f657600080fd5b506102ff610bfc565b005b34801561030d57600080fd5b5061032860048036038101906103239190611fb1565b610c10565b604051610339959493929190611fde565b60405180910390f35b34801561034e57600080fd5b50610357610c60565b6040516103649190611eec565b60405180910390f35b34801561037957600080fd5b50610382610c66565b60405161038f9190612040565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612087565b610c8f565b005b3480156103cd57600080fd5b506103e860048036038101906103e39190611c79565b610e2e565b005b3480156103f657600080fd5b50610411600480360381019061040c9190611fb1565b610ed4565b60405161042396959493929190612137565b60405180910390f35b34801561043857600080fd5b50610453600480360381019061044e9190611c79565b610f65565b005b61046f600480360381019061046a9190611fb1565b61100b565b005b34801561047d57600080fd5b5061049860048036038101906104939190612198565b6113c4565b005b3480156104a657600080fd5b506104c160048036038101906104bc9190611c79565b61171f565b005b6060600060016003546104d69190612207565b905060008167ffffffffffffffff8111156104f4576104f361223b565b5b60405190808252806020026020018201604052801561052d57816020015b61051a611988565b8152602001906001900390816105125790505b5090506000600190505b8281116105ed57600260008281526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff161515151581525050826001836105be9190612207565b815181106105cf576105ce61226a565b5b602002602001018190525080806105e590612299565b915050610537565b50809250505090565b60076020528060005260406000206000915054906101000a900460ff1681565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166106a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106999061232d565b60405180910390fd5b6106aa6117a5565b8181905084849050146106f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e990612399565b60405180910390fd5b60005b848490508110156108885760008585838181106107155761071461226a565b5b905060200201602081019061072a9190611c79565b73ffffffffffffffffffffffffffffffffffffffff168484848181106107535761075261226a565b5b90506020020135604051610766906123ea565b60006040518083038185875af1925050503d80600081146107a3576040519150601f19603f3d011682016040523d82523d6000602084013e6107a8565b606091505b50509050806107ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e39061244b565b60405180910390fd5b8585838181106107ff576107fe61226a565b5b90506020020160208101906108149190611c79565b73ffffffffffffffffffffffffffffffffffffffff167fdf29796aad820e4bb192f3a8d631b76519bcd2cbe77cc85af20e9df53cece08685858581811061085e5761085d61226a565b5b905060200201356040516108729190611eec565b60405180910390a25080806001019150506106f5565b506108916117eb565b50505050565b6060600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561092257602002820191906000526020600020905b81548152602001906001019080831161090e575b50505050509050919050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166109ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b19061232d565b60405180910390fd5b6109c26117f4565b60003411610a05576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109fc906124b7565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f525b74a34fa7d280989782ff88faded7890117edd2a674614497b9ed45b4598834604051610a4b9190611eec565b60405180910390a2565b60035481565b60008060149054906101000a900460ff16905090565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610afd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af49061232d565b60405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff1682604051610b23906123ea565b60006040518083038185875af1925050503d8060008114610b60576040519150601f19603f3d011682016040523d82523d6000602084013e610b65565b606091505b5050905080610ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba09061244b565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff167f2942786ae16b31946d95891028628499df0883a3dd49b4ff21eb67337faf1c1183604051610bef9190611eec565b60405180910390a2505050565b610c04611835565b610c0e60006118bc565b565b60026020528060005260406000206000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16908060030160019054906101000a900460ff16905085565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d129061232d565b60405180910390fd5b60008603610d3d5760036000815480929190610d3690612299565b9190505595505b6040518060a0016040528086815260200185815260200184815260200183151581526020018215158152506002600088815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030160006101000a81548160ff02191690831515021790555060808201518160030160016101000a81548160ff021916908315150217905550905050857f9e0892505f2a54d7fbab3b5678b5474c9f9473d0f5a3342ee63ca1ac6a3e3ac260026000898152602001908152602001600020604051610e1e91906125f0565b60405180910390a2505050505050565b610e36611835565b6001600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d60405160405180910390a250565b60046020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154908060020154908060030160009054906101000a900467ffffffffffffffff16908060030160089054906101000a900467ffffffffffffffff16908060030160109054906101000a900460ff16905086565b610f6d611835565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d60405160405180910390a250565b6110136117f4565b806002600082815260200190815260200160002060030160019054906101000a900460ff16611077576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106e90612657565b60405180910390fd5b600034116110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b1906124b7565b60405180910390fd5b6000600260008481526020019081526020016000206040518060a00160405290816000820154815260200160018201548152602001600282015481526020016003820160009054906101000a900460ff161515151581526020016003820160019054906101000a900460ff16151515158152505090508060400151341015611177576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116e906126c3565b60405180910390fd5b600042905060008083600001511461119e5782600001514261119991906126e3565b6111a0565b815b90506000600560008154809291906111b790612299565b9190505590506040518060c001604052803373ffffffffffffffffffffffffffffffffffffffff1681526020018781526020013481526020018467ffffffffffffffff1681526020018367ffffffffffffffff168152602001600015158152506004600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060808201518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060a08201518160030160106101000a81548160ff021916908315150217905550905050600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505060019003906000526020600020016000909190919091505585813373ffffffffffffffffffffffffffffffffffffffff167f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada3346040516113b49190611eec565b60405180910390a4505050505050565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611450576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114479061232d565b60405180910390fd5b6114586117a5565b60006004600083815260200190815260200160002090508060030160109054906101000a900460ff16156114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b890612763565b60405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154a906127cf565b60405180910390fd5b8060030160089054906101000a900467ffffffffffffffff1667ffffffffffffffff164210156115b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115af9061283b565b60405180910390fd5b60008160020154905060018260030160106101000a81548160ff0219169083151502179055506000826002018190555060008473ffffffffffffffffffffffffffffffffffffffff168260405161160e906123ea565b60006040518083038185875af1925050503d806000811461164b576040519150601f19603f3d011682016040523d82523d6000602084013e611650565b606091505b5050905080611694576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161168b9061244b565b60405180910390fd5b838573ffffffffffffffffffffffffffffffffffffffff167fadec52fcd1408589179b85e44b434374db078b4eaf793e7d1a1bb0ae4ecfeee5846040516116db9190611eec565b60405180910390a3837fbf542298705ed6fd22ddf94ee2db731ced9191396e6e7f7b6862803555f9ff2160405160405180910390a250505061171b6117eb565b5050565b611727611835565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036117995760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016117909190612040565b60405180910390fd5b6117a2816118bc565b50565b6002600154036117e1576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600181905550565b60018081905550565b6117fc610a5b565b15611833576040517fd93c066500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b565b61183d611980565b73ffffffffffffffffffffffffffffffffffffffff1661185b610c66565b73ffffffffffffffffffffffffffffffffffffffff16146118ba5761187e611980565b6040517f118cdaa70000000000000000000000000000000000000000000000000000000081526004016118b19190612040565b60405180910390fd5b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600033905090565b6040518060a001604052806000815260200160008152602001600081526020016000151581526020016000151581525090565b600082825260208201905092915050565b7f757365206465706f7369742829206f722066756e645265776172642829000000600082015250565b6000611a02601d836119bb565b9150611a0d826119cc565b602082019050919050565b60006020820190508181036000830152611a31816119f5565b9050919050565b7f696e76616c69642063616c6c0000000000000000000000000000000000000000600082015250565b6000611a6e600c836119bb565b9150611a7982611a38565b602082019050919050565b60006020820190508181036000830152611a9d81611a61565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000819050919050565b611ae381611ad0565b82525050565b60008115159050919050565b611afe81611ae9565b82525050565b60a082016000820151611b1a6000850182611ada565b506020820151611b2d6020850182611ada565b506040820151611b406040850182611ada565b506060820151611b536060850182611af5565b506080820151611b666080850182611af5565b50505050565b6000611b788383611b04565b60a08301905092915050565b6000602082019050919050565b6000611b9c82611aa4565b611ba68185611aaf565b9350611bb183611ac0565b8060005b83811015611be2578151611bc98882611b6c565b9750611bd483611b84565b925050600181019050611bb5565b5085935050505092915050565b60006020820190508181036000830152611c098184611b91565b905092915050565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c4682611c1b565b9050919050565b611c5681611c3b565b8114611c6157600080fd5b50565b600081359050611c7381611c4d565b92915050565b600060208284031215611c8f57611c8e611c11565b5b6000611c9d84828501611c64565b91505092915050565b611caf81611ae9565b82525050565b6000602082019050611cca6000830184611ca6565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f840112611cf557611cf4611cd0565b5b8235905067ffffffffffffffff811115611d1257611d11611cd5565b5b602083019150836020820283011115611d2e57611d2d611cda565b5b9250929050565b60008083601f840112611d4b57611d4a611cd0565b5b8235905067ffffffffffffffff811115611d6857611d67611cd5565b5b602083019150836020820283011115611d8457611d83611cda565b5b9250929050565b60008060008060408587031215611da557611da4611c11565b5b600085013567ffffffffffffffff811115611dc357611dc2611c16565b5b611dcf87828801611cdf565b9450945050602085013567ffffffffffffffff811115611df257611df1611c16565b5b611dfe87828801611d35565b925092505092959194509250565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000611e448383611ada565b60208301905092915050565b6000602082019050919050565b6000611e6882611e0c565b611e728185611e17565b9350611e7d83611e28565b8060005b83811015611eae578151611e958882611e38565b9750611ea083611e50565b925050600181019050611e81565b5085935050505092915050565b60006020820190508181036000830152611ed58184611e5d565b905092915050565b611ee681611ad0565b82525050565b6000602082019050611f016000830184611edd565b92915050565b6000611f1282611c1b565b9050919050565b611f2281611f07565b8114611f2d57600080fd5b50565b600081359050611f3f81611f19565b92915050565b611f4e81611ad0565b8114611f5957600080fd5b50565b600081359050611f6b81611f45565b92915050565b60008060408385031215611f8857611f87611c11565b5b6000611f9685828601611f30565b9250506020611fa785828601611f5c565b9150509250929050565b600060208284031215611fc757611fc6611c11565b5b6000611fd584828501611f5c565b91505092915050565b600060a082019050611ff36000830188611edd565b6120006020830187611edd565b61200d6040830186611edd565b61201a6060830185611ca6565b6120276080830184611ca6565b9695505050505050565b61203a81611c3b565b82525050565b60006020820190506120556000830184612031565b92915050565b61206481611ae9565b811461206f57600080fd5b50565b6000813590506120818161205b565b92915050565b60008060008060008060c087890312156120a4576120a3611c11565b5b60006120b289828a01611f5c565b96505060206120c389828a01611f5c565b95505060406120d489828a01611f5c565b94505060606120e589828a01611f5c565b93505060806120f689828a01612072565b92505060a061210789828a01612072565b9150509295509295509295565b600067ffffffffffffffff82169050919050565b61213181612114565b82525050565b600060c08201905061214c6000830189612031565b6121596020830188611edd565b6121666040830187611edd565b6121736060830186612128565b6121806080830185612128565b61218d60a0830184611ca6565b979650505050505050565b600080604083850312156121af576121ae611c11565b5b60006121bd85828601611c64565b92505060206121ce85828601611f5c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061221282611ad0565b915061221d83611ad0565b9250828203905081811115612235576122346121d8565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006122a482611ad0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036122d6576122d56121d8565b5b600182019050919050565b7f6e6f74206f70657261746f720000000000000000000000000000000000000000600082015250565b6000612317600c836119bb565b9150612322826122e1565b602082019050919050565b600060208201905081810360008301526123468161230a565b9050919050565b7f6c656e677468206d69736d617463680000000000000000000000000000000000600082015250565b6000612383600f836119bb565b915061238e8261234d565b602082019050919050565b600060208201905081810360008301526123b281612376565b9050919050565b600081905092915050565b50565b60006123d46000836123b9565b91506123df826123c4565b600082019050919050565b60006123f5826123c7565b9150819050919050565b7f7472616e73666572206661696c65640000000000000000000000000000000000600082015250565b6000612435600f836119bb565b9150612440826123ff565b602082019050919050565b6000602082019050818103600083015261246481612428565b9050919050565b7f616d6f756e743d30000000000000000000000000000000000000000000000000600082015250565b60006124a16008836119bb565b91506124ac8261246b565b602082019050919050565b600060208201905081810360008301526124d081612494565b9050919050565b60008160001c9050919050565b6000819050919050565b60006125016124fc836124d7565b6124e4565b9050919050565b600060ff82169050919050565b6000612528612523836124d7565b612508565b9050919050565b60008160081c9050919050565b600061254f61254a8361252f565b612508565b9050919050565b60a08201600080830154905061256b816124ee565b6125786000860182611ada565b5060018301549050612589816124ee565b6125966020860182611ada565b50600283015490506125a7816124ee565b6125b46040860182611ada565b50600383015490506125c581612515565b6125d26060860182611af5565b506125dc8161253c565b6125e96080860182611af5565b5050505050565b600060a0820190506126056000830184612556565b92915050565b7f70726f6475637420696e61637469766500000000000000000000000000000000600082015250565b60006126416010836119bb565b915061264c8261260b565b602082019050919050565b6000602082019050818103600083015261267081612634565b9050919050565b7f62656c6f77206d696e206465706f736974000000000000000000000000000000600082015250565b60006126ad6011836119bb565b91506126b882612677565b602082019050919050565b600060208201905081810360008301526126dc816126a0565b9050919050565b60006126ee82611ad0565b91506126f983611ad0565b9250828201905080821115612711576127106121d8565b5b92915050565b7f616c726561647920636c6f736564000000000000000000000000000000000000600082015250565b600061274d600e836119bb565b915061275882612717565b602082019050919050565b6000602082019050818103600083015261277c81612740565b9050919050565b7f6e6f74206f776e65720000000000000000000000000000000000000000000000600082015250565b60006127b96009836119bb565b91506127c482612783565b602082019050919050565b600060208201905081810360008301526127e8816127ac565b9050919050565b7f6e6f74206d617475726564000000000000000000000000000000000000000000600082015250565b6000612825600b836119bb565b9150612830826127ef565b602082019050919050565b6000602082019050818103600083015261285481612818565b905091905056fea264697066735822122016b106134a191f7aa41147a22cd228e646bdd5ae5a9a23343247505fb717c0d664736f6c634300081c0033";

    private static String librariesLinkedBinary;

    public static final String FUNC_ADDOPERATOR = "addOperator";

    public static final String FUNC_DEPOSIT = "deposit";

    public static final String FUNC_DISTRIBUTEREWARDS = "distributeRewards";

    public static final String FUNC_FUNDREWARD = "fundReward";

    public static final String FUNC_GETALLPRODUCTS = "getAllProducts";

    public static final String FUNC_GETUSERPOSITIONS = "getUserPositions";

    public static final String FUNC_NEXTPOSITIONID = "nextPositionId";

    public static final String FUNC_NEXTPRODUCTID = "nextProductId";

    public static final String FUNC_OPERATORS = "operators";

    public static final String FUNC_OWNER = "owner";

    public static final String FUNC_PAUSED = "paused";

    public static final String FUNC_POSITIONS = "positions";

    public static final String FUNC_PRODUCTS = "products";

    public static final String FUNC_REMOVEOPERATOR = "removeOperator";

    public static final String FUNC_RENOUNCEOWNERSHIP = "renounceOwnership";

    public static final String FUNC_SETPRODUCT = "setProduct";

    public static final String FUNC_SWEEP = "sweep";

    public static final String FUNC_TRANSFEROWNERSHIP = "transferOwnership";

    public static final String FUNC_WITHDRAWFOR = "withdrawFor";

    public static final Event DEPOSITED_EVENT = new Event("Deposited",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>(true) {}, new TypeReference<Uint256>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event OPERATORADDED_EVENT = new Event("OperatorAdded",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}));
    ;

    public static final Event OPERATORREMOVED_EVENT = new Event("OperatorRemoved",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}));
    ;

    public static final Event OWNERSHIPTRANSFERRED_EVENT = new Event("OwnershipTransferred",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event PAUSED_EVENT = new Event("Paused",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final Event POSITIONCLOSED_EVENT = new Event("PositionClosed",
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}));
    ;

    public static final Event PRODUCTSET_EVENT = new Event("ProductSet",
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>(true) {}, new TypeReference<Product>() {}));
    ;

    public static final Event REWARDFUNDED_EVENT = new Event("RewardFunded",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event REWARDSWEPT_EVENT = new Event("RewardSwept",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event REWARDSDISTRIBUTED_EVENT = new Event("RewardsDistributed",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event UNPAUSED_EVENT = new Event("Unpaused",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final Event WITHDREW_EVENT = new Event("Withdrew",
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint256>(true) {}, new TypeReference<Uint256>() {}));
    ;

    @Deprecated
    protected StakingVaultNative(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected StakingVaultNative(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected StakingVaultNative(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected StakingVaultNative(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static List<DepositedEventResponse> getDepositedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(DEPOSITED_EVENT, transactionReceipt);
        ArrayList<DepositedEventResponse> responses = new ArrayList<DepositedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            DepositedEventResponse typedResponse = new DepositedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.user = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.positionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.productId = (BigInteger) eventValues.getIndexedValues().get(2).getValue();
            typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static DepositedEventResponse getDepositedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(DEPOSITED_EVENT, log);
        DepositedEventResponse typedResponse = new DepositedEventResponse();
        typedResponse.log = log;
        typedResponse.user = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.positionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.productId = (BigInteger) eventValues.getIndexedValues().get(2).getValue();
        typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<DepositedEventResponse> depositedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getDepositedEventFromLog(log));
    }

    public Flowable<DepositedEventResponse> depositedEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(DEPOSITED_EVENT));
        return depositedEventFlowable(filter);
    }

    public static List<OperatorAddedEventResponse> getOperatorAddedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OPERATORADDED_EVENT, transactionReceipt);
        ArrayList<OperatorAddedEventResponse> responses = new ArrayList<OperatorAddedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            OperatorAddedEventResponse typedResponse = new OperatorAddedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.op = (String) eventValues.getIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OperatorAddedEventResponse getOperatorAddedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OPERATORADDED_EVENT, log);
        OperatorAddedEventResponse typedResponse = new OperatorAddedEventResponse();
        typedResponse.log = log;
        typedResponse.op = (String) eventValues.getIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<OperatorAddedEventResponse> operatorAddedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOperatorAddedEventFromLog(log));
    }

    public Flowable<OperatorAddedEventResponse> operatorAddedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OPERATORADDED_EVENT));
        return operatorAddedEventFlowable(filter);
    }

    public static List<OperatorRemovedEventResponse> getOperatorRemovedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OPERATORREMOVED_EVENT, transactionReceipt);
        ArrayList<OperatorRemovedEventResponse> responses = new ArrayList<OperatorRemovedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            OperatorRemovedEventResponse typedResponse = new OperatorRemovedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.op = (String) eventValues.getIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OperatorRemovedEventResponse getOperatorRemovedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OPERATORREMOVED_EVENT, log);
        OperatorRemovedEventResponse typedResponse = new OperatorRemovedEventResponse();
        typedResponse.log = log;
        typedResponse.op = (String) eventValues.getIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<OperatorRemovedEventResponse> operatorRemovedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOperatorRemovedEventFromLog(log));
    }

    public Flowable<OperatorRemovedEventResponse> operatorRemovedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OPERATORREMOVED_EVENT));
        return operatorRemovedEventFlowable(filter);
    }

    public static List<OwnershipTransferredEventResponse> getOwnershipTransferredEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OWNERSHIPTRANSFERRED_EVENT, transactionReceipt);
        ArrayList<OwnershipTransferredEventResponse> responses = new ArrayList<OwnershipTransferredEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            OwnershipTransferredEventResponse typedResponse = new OwnershipTransferredEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.newOwner = (String) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OwnershipTransferredEventResponse getOwnershipTransferredEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OWNERSHIPTRANSFERRED_EVENT, log);
        OwnershipTransferredEventResponse typedResponse = new OwnershipTransferredEventResponse();
        typedResponse.log = log;
        typedResponse.previousOwner = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.newOwner = (String) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<OwnershipTransferredEventResponse> ownershipTransferredEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOwnershipTransferredEventFromLog(log));
    }

    public Flowable<OwnershipTransferredEventResponse> ownershipTransferredEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OWNERSHIPTRANSFERRED_EVENT));
        return ownershipTransferredEventFlowable(filter);
    }

    public static List<PausedEventResponse> getPausedEvents(TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(PAUSED_EVENT, transactionReceipt);
        ArrayList<PausedEventResponse> responses = new ArrayList<PausedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            PausedEventResponse typedResponse = new PausedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static PausedEventResponse getPausedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PAUSED_EVENT, log);
        PausedEventResponse typedResponse = new PausedEventResponse();
        typedResponse.log = log;
        typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<PausedEventResponse> pausedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getPausedEventFromLog(log));
    }

    public Flowable<PausedEventResponse> pausedEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(PAUSED_EVENT));
        return pausedEventFlowable(filter);
    }

    public static List<PositionClosedEventResponse> getPositionClosedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(POSITIONCLOSED_EVENT, transactionReceipt);
        ArrayList<PositionClosedEventResponse> responses = new ArrayList<PositionClosedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            PositionClosedEventResponse typedResponse = new PositionClosedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.positionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static PositionClosedEventResponse getPositionClosedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(POSITIONCLOSED_EVENT, log);
        PositionClosedEventResponse typedResponse = new PositionClosedEventResponse();
        typedResponse.log = log;
        typedResponse.positionId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<PositionClosedEventResponse> positionClosedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getPositionClosedEventFromLog(log));
    }

    public Flowable<PositionClosedEventResponse> positionClosedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(POSITIONCLOSED_EVENT));
        return positionClosedEventFlowable(filter);
    }

    public static List<ProductSetEventResponse> getProductSetEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(PRODUCTSET_EVENT, transactionReceipt);
        ArrayList<ProductSetEventResponse> responses = new ArrayList<ProductSetEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            ProductSetEventResponse typedResponse = new ProductSetEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.productId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.product = (Product) eventValues.getNonIndexedValues().get(0);
            responses.add(typedResponse);
        }
        return responses;
    }

    public static ProductSetEventResponse getProductSetEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(PRODUCTSET_EVENT, log);
        ProductSetEventResponse typedResponse = new ProductSetEventResponse();
        typedResponse.log = log;
        typedResponse.productId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.product = (Product) eventValues.getNonIndexedValues().get(0);
        return typedResponse;
    }

    public Flowable<ProductSetEventResponse> productSetEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getProductSetEventFromLog(log));
    }

    public Flowable<ProductSetEventResponse> productSetEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(PRODUCTSET_EVENT));
        return productSetEventFlowable(filter);
    }

    public static List<RewardFundedEventResponse> getRewardFundedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(REWARDFUNDED_EVENT, transactionReceipt);
        ArrayList<RewardFundedEventResponse> responses = new ArrayList<RewardFundedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            RewardFundedEventResponse typedResponse = new RewardFundedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RewardFundedEventResponse getRewardFundedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REWARDFUNDED_EVENT, log);
        RewardFundedEventResponse typedResponse = new RewardFundedEventResponse();
        typedResponse.log = log;
        typedResponse.from = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<RewardFundedEventResponse> rewardFundedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRewardFundedEventFromLog(log));
    }

    public Flowable<RewardFundedEventResponse> rewardFundedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(REWARDFUNDED_EVENT));
        return rewardFundedEventFlowable(filter);
    }

    public static List<RewardSweptEventResponse> getRewardSweptEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(REWARDSWEPT_EVENT, transactionReceipt);
        ArrayList<RewardSweptEventResponse> responses = new ArrayList<RewardSweptEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            RewardSweptEventResponse typedResponse = new RewardSweptEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RewardSweptEventResponse getRewardSweptEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REWARDSWEPT_EVENT, log);
        RewardSweptEventResponse typedResponse = new RewardSweptEventResponse();
        typedResponse.log = log;
        typedResponse.to = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<RewardSweptEventResponse> rewardSweptEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRewardSweptEventFromLog(log));
    }

    public Flowable<RewardSweptEventResponse> rewardSweptEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(REWARDSWEPT_EVENT));
        return rewardSweptEventFlowable(filter);
    }

    public static List<RewardsDistributedEventResponse> getRewardsDistributedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(REWARDSDISTRIBUTED_EVENT, transactionReceipt);
        ArrayList<RewardsDistributedEventResponse> responses = new ArrayList<RewardsDistributedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            RewardsDistributedEventResponse typedResponse = new RewardsDistributedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.user = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RewardsDistributedEventResponse getRewardsDistributedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(REWARDSDISTRIBUTED_EVENT, log);
        RewardsDistributedEventResponse typedResponse = new RewardsDistributedEventResponse();
        typedResponse.log = log;
        typedResponse.user = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.amount = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<RewardsDistributedEventResponse> rewardsDistributedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRewardsDistributedEventFromLog(log));
    }

    public Flowable<RewardsDistributedEventResponse> rewardsDistributedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(REWARDSDISTRIBUTED_EVENT));
        return rewardsDistributedEventFlowable(filter);
    }

    public static List<UnpausedEventResponse> getUnpausedEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(UNPAUSED_EVENT, transactionReceipt);
        ArrayList<UnpausedEventResponse> responses = new ArrayList<UnpausedEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            UnpausedEventResponse typedResponse = new UnpausedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static UnpausedEventResponse getUnpausedEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(UNPAUSED_EVENT, log);
        UnpausedEventResponse typedResponse = new UnpausedEventResponse();
        typedResponse.log = log;
        typedResponse.account = (String) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<UnpausedEventResponse> unpausedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getUnpausedEventFromLog(log));
    }

    public Flowable<UnpausedEventResponse> unpausedEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(UNPAUSED_EVENT));
        return unpausedEventFlowable(filter);
    }

    public static List<WithdrewEventResponse> getWithdrewEvents(
            TransactionReceipt transactionReceipt) {
        List<EventValuesWithLog> valueList = staticExtractEventParametersWithLog(WITHDREW_EVENT, transactionReceipt);
        ArrayList<WithdrewEventResponse> responses = new ArrayList<WithdrewEventResponse>(valueList.size());
        for (EventValuesWithLog eventValues : valueList) {
            WithdrewEventResponse typedResponse = new WithdrewEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.user = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.positionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.amountWithdrawn = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static WithdrewEventResponse getWithdrewEventFromLog(Log log) {
        EventValuesWithLog eventValues = staticExtractEventParametersWithLog(WITHDREW_EVENT, log);
        WithdrewEventResponse typedResponse = new WithdrewEventResponse();
        typedResponse.log = log;
        typedResponse.user = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.positionId = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.amountWithdrawn = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<WithdrewEventResponse> withdrewEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getWithdrewEventFromLog(log));
    }

    public Flowable<WithdrewEventResponse> withdrewEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(WITHDREW_EVENT));
        return withdrewEventFlowable(filter);
    }

    public RemoteFunctionCall<TransactionReceipt> addOperator(String op) {
        final Function function = new Function(
                FUNC_ADDOPERATOR,
                Arrays.<Type>asList(new Address(160, op)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> deposit(BigInteger productId,
            BigInteger weiValue) {
        final Function function = new Function(
                FUNC_DEPOSIT,
                Arrays.<Type>asList(new Uint256(productId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function, weiValue);
    }

    public RemoteFunctionCall<TransactionReceipt> distributeRewards(List<String> users,
            List<BigInteger> amounts) {
        final Function function = new Function(
                FUNC_DISTRIBUTEREWARDS,
                Arrays.<Type>asList(new DynamicArray<Address>(
                        Address.class,
                        org.web3j.abi.Utils.typeMap(users, Address.class)),
                new DynamicArray<Uint256>(
                        Uint256.class,
                        org.web3j.abi.Utils.typeMap(amounts, Uint256.class))),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> fundReward(BigInteger weiValue) {
        final Function function = new Function(
                FUNC_FUNDREWARD,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function, weiValue);
    }

    public RemoteFunctionCall<List> getAllProducts() {
        final Function function = new Function(FUNC_GETALLPRODUCTS,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Product>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<List> getUserPositions(String user) {
        final Function function = new Function(FUNC_GETUSERPOSITIONS,
                Arrays.<Type>asList(new Address(160, user)),
                Arrays.<TypeReference<?>>asList(new TypeReference<DynamicArray<Uint256>>() {}));
        return new RemoteFunctionCall<List>(function,
                new Callable<List>() {
                    @Override
                    @SuppressWarnings("unchecked")
                    public List call() throws Exception {
                        List<Type> result = (List<Type>) executeCallSingleValueReturn(function, List.class);
                        return convertToNative(result);
                    }
                });
    }

    public RemoteFunctionCall<BigInteger> nextPositionId() {
        final Function function = new Function(FUNC_NEXTPOSITIONID,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> nextProductId() {
        final Function function = new Function(FUNC_NEXTPRODUCTID,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<Boolean> operators(String param0) {
        final Function function = new Function(FUNC_OPERATORS,
                Arrays.<Type>asList(new Address(160, param0)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<String> owner() {
        final Function function = new Function(FUNC_OWNER,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
        return executeRemoteCallSingleValueReturn(function, String.class);
    }

    public RemoteFunctionCall<Boolean> paused() {
        final Function function = new Function(FUNC_PAUSED,
                Arrays.<Type>asList(),
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<Tuple6<String, BigInteger, BigInteger, BigInteger, BigInteger, Boolean>> positions(
            BigInteger param0) {
        final Function function = new Function(FUNC_POSITIONS,
                Arrays.<Type>asList(new Uint256(param0)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint64>() {}, new TypeReference<Uint64>() {}, new TypeReference<Bool>() {}));
        return new RemoteFunctionCall<Tuple6<String, BigInteger, BigInteger, BigInteger, BigInteger, Boolean>>(function,
                new Callable<Tuple6<String, BigInteger, BigInteger, BigInteger, BigInteger, Boolean>>() {
                    @Override
                    public Tuple6<String, BigInteger, BigInteger, BigInteger, BigInteger, Boolean> call(
                            ) throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple6<String, BigInteger, BigInteger, BigInteger, BigInteger, Boolean>(
                                (String) results.get(0).getValue(),
                                (BigInteger) results.get(1).getValue(),
                                (BigInteger) results.get(2).getValue(),
                                (BigInteger) results.get(3).getValue(),
                                (BigInteger) results.get(4).getValue(),
                                (Boolean) results.get(5).getValue());
                    }
                });
    }

    public RemoteFunctionCall<Tuple5<BigInteger, BigInteger, BigInteger, Boolean, Boolean>> products(
            BigInteger param0) {
        final Function function = new Function(FUNC_PRODUCTS,
                Arrays.<Type>asList(new Uint256(param0)),
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Bool>() {}, new TypeReference<Bool>() {}));
        return new RemoteFunctionCall<Tuple5<BigInteger, BigInteger, BigInteger, Boolean, Boolean>>(function,
                new Callable<Tuple5<BigInteger, BigInteger, BigInteger, Boolean, Boolean>>() {
                    @Override
                    public Tuple5<BigInteger, BigInteger, BigInteger, Boolean, Boolean> call()
                            throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple5<BigInteger, BigInteger, BigInteger, Boolean, Boolean>(
                                (BigInteger) results.get(0).getValue(),
                                (BigInteger) results.get(1).getValue(),
                                (BigInteger) results.get(2).getValue(),
                                (Boolean) results.get(3).getValue(),
                                (Boolean) results.get(4).getValue());
                    }
                });
    }

    public RemoteFunctionCall<TransactionReceipt> removeOperator(String op) {
        final Function function = new Function(
                FUNC_REMOVEOPERATOR,
                Arrays.<Type>asList(new Address(160, op)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> renounceOwnership() {
        final Function function = new Function(
                FUNC_RENOUNCEOWNERSHIP,
                Arrays.<Type>asList(),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setProduct(BigInteger productId,
            BigInteger lockDuration, BigInteger dailyRateBP, BigInteger minDeposit,
            Boolean interestClaimable, Boolean active) {
        final Function function = new Function(
                FUNC_SETPRODUCT,
                Arrays.<Type>asList(new Uint256(productId),
                new Uint256(lockDuration),
                new Uint256(dailyRateBP),
                new Uint256(minDeposit),
                new Bool(interestClaimable),
                new Bool(active)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> sweep(String to, BigInteger amount) {
        final Function function = new Function(
                FUNC_SWEEP,
                Arrays.<Type>asList(new Address(160, to),
                new Uint256(amount)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> transferOwnership(String newOwner) {
        final Function function = new Function(
                FUNC_TRANSFEROWNERSHIP,
                Arrays.<Type>asList(new Address(160, newOwner)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> withdrawFor(String user, BigInteger positionId) {
        final Function function = new Function(
                FUNC_WITHDRAWFOR,
                Arrays.<Type>asList(new Address(160, user),
                new Uint256(positionId)),
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    @Deprecated
    public static StakingVaultNative load(String contractAddress, Web3j web3j,
            Credentials credentials, BigInteger gasPrice, BigInteger gasLimit) {
        return new StakingVaultNative(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static StakingVaultNative load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new StakingVaultNative(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static StakingVaultNative load(String contractAddress, Web3j web3j,
            Credentials credentials, ContractGasProvider contractGasProvider) {
        return new StakingVaultNative(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static StakingVaultNative load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new StakingVaultNative(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<StakingVaultNative> deploy(Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider, String initialOwner, String initialOperator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, initialOwner),
                new Address(160, initialOperator)));
        return deployRemoteCall(StakingVaultNative.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), encodedConstructor);
    }

    public static RemoteCall<StakingVaultNative> deploy(Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider,
            String initialOwner, String initialOperator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, initialOwner),
                new Address(160, initialOperator)));
        return deployRemoteCall(StakingVaultNative.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<StakingVaultNative> deploy(Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit, String initialOwner, String initialOperator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, initialOwner),
                new Address(160, initialOperator)));
        return deployRemoteCall(StakingVaultNative.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor);
    }

    @Deprecated
    public static RemoteCall<StakingVaultNative> deploy(Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit,
            String initialOwner, String initialOperator) {
        String encodedConstructor = FunctionEncoder.encodeConstructor(Arrays.<Type>asList(new Address(160, initialOwner),
                new Address(160, initialOperator)));
        return deployRemoteCall(StakingVaultNative.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), encodedConstructor);
    }

    public static void linkLibraries(List<LinkReference> references) {
        librariesLinkedBinary = linkBinaryWithReferences(BINARY, references);
    }

    private static String getDeploymentBinary() {
        if (librariesLinkedBinary != null) {
            return librariesLinkedBinary;
        } else {
            return BINARY;
        }
    }

    public static class Product extends StaticStruct {
        public BigInteger lockDuration;

        public BigInteger dailyRateBP;

        public BigInteger minDeposit;

        public Boolean interestClaimable;

        public Boolean active;

        public Product(BigInteger lockDuration, BigInteger dailyRateBP, BigInteger minDeposit,
                Boolean interestClaimable, Boolean active) {
            super(new Uint256(lockDuration),
                    new Uint256(dailyRateBP),
                    new Uint256(minDeposit),
                    new Bool(interestClaimable),
                    new Bool(active));
            this.lockDuration = lockDuration;
            this.dailyRateBP = dailyRateBP;
            this.minDeposit = minDeposit;
            this.interestClaimable = interestClaimable;
            this.active = active;
        }

        public Product(Uint256 lockDuration, Uint256 dailyRateBP, Uint256 minDeposit,
                Bool interestClaimable, Bool active) {
            super(lockDuration, dailyRateBP, minDeposit, interestClaimable, active);
            this.lockDuration = lockDuration.getValue();
            this.dailyRateBP = dailyRateBP.getValue();
            this.minDeposit = minDeposit.getValue();
            this.interestClaimable = interestClaimable.getValue();
            this.active = active.getValue();
        }
    }

    public static class DepositedEventResponse extends BaseEventResponse {
        public String user;

        public BigInteger positionId;

        public BigInteger productId;

        public BigInteger amount;
    }

    public static class OperatorAddedEventResponse extends BaseEventResponse {
        public String op;
    }

    public static class OperatorRemovedEventResponse extends BaseEventResponse {
        public String op;
    }

    public static class OwnershipTransferredEventResponse extends BaseEventResponse {
        public String previousOwner;

        public String newOwner;
    }

    public static class PausedEventResponse extends BaseEventResponse {
        public String account;
    }

    public static class PositionClosedEventResponse extends BaseEventResponse {
        public BigInteger positionId;
    }

    public static class ProductSetEventResponse extends BaseEventResponse {
        public BigInteger productId;

        public Product product;
    }

    public static class RewardFundedEventResponse extends BaseEventResponse {
        public String from;

        public BigInteger amount;
    }

    public static class RewardSweptEventResponse extends BaseEventResponse {
        public String to;

        public BigInteger amount;
    }

    public static class RewardsDistributedEventResponse extends BaseEventResponse {
        public String user;

        public BigInteger amount;
    }

    public static class UnpausedEventResponse extends BaseEventResponse {
        public String account;
    }

    public static class WithdrewEventResponse extends BaseEventResponse {
        public String user;

        public BigInteger positionId;

        public BigInteger amountWithdrawn;
    }
}
